const dns = require('dns');

dns.resolve('www.baidu.com', (err, res) => {
	if (err) {
		console.log('错误');
	} else {
		console.log(res);   //[ '61.135.169.121', '61.135.169.125' ]
	}
})